import { service } from "./communityServe";

export const options = (params) =>
  service.get("/v1/posts/plate/options", params); //圈子分区
export const circle = (params) => service.post("/v1/posts/add/circle", params); //创建圈子
export const Mycircle = (params) => service.get("/v1/user/cricle", params); //我创建的圈子
export const nearlyAndfollows = (params) =>
  service.get("/v1/circle/nearlyAndfollow", params); //我的关注
export const byplateid = (params) =>
  service.get("/v1/posts/circle/byplateid" + params.id, params); //圈子列表
export const search = (params) =>
  service.get("/v1/posts/circle/search" + params.id, params); //搜索
export const foucecircle = (params) =>
  service.post("/v1/user/follow/circle", params); //关注user/posts/byUserId
export const byUserId = (params) =>
  service.get("/v1/user/info/byUserId" + params.id, params); //获取他人用户信息
export const postsbyUserId = (params) =>
  service.get("/v1/user/posts/byUserId" + params.id, params); //笔记
export const followUser = (params) =>
  service.get("/v1/user/followUser" + params.id, params); //关注列表
export const fansUser = (params) =>
  service.get("/v1/user/fansUser" + params.id, params); //粉丝列表
export const getCircleUserList = (params) =>
  service.get("/v1/circle/getCircleUserList" + params.id, params); //圈子有谁
export const followNow = (params) => service.post("/v1/user/follow", params); //关注

export const configData = (params) =>
  service.get("/v1/configData" + (params ? params.id : "")); //获取首页配置

export const circleinfo = (params) =>
  service.get("/v1/circle/info" + params.id, params); //圈子详情

export const postsNote = (params) =>
  service.get("/v1/user/posts" + params.id, params); //与我相关的笔记/
export const paycode = (params) =>
  service.get("/v1/user/paycode" + params.id, params); //支付密码
export const myFinancial = (params) =>
  service.get("/v1/user/myFinancial" + params.id, params); //查询余额
export const financialRecord = (params) =>
  service.get("/v1/user/financialRecord" + params.id, params); //查询余额列表
export const coinsRecord = (params) =>
  service.get("/v1/user/coinsRecord" + params.id, params); //查询燃油记录
export const myUserWithdrawal = (params) =>
  service.get("/v1/user/myUserWithdrawal" + params.id, params); //查询提现记录
export const initiateWithdrawal = (params) =>
  service.post("/v1/user/initiateWithdrawal", params); //申请提现

export const indexPosts = (params) =>
  service.get(
    `/v1/index/posts?page=${params.page}&type=${params.type}&plate_id=${params.plate_id}`
  ); //获取帖子列表
export const userVote = (params) => service.post("/v1/user/vote", params); //用户投票

export const postsLike = (params) => service.post("/v1/posts/like", params); //帖子点赞

export const commentByPostsId = (params) =>
  service.get(
    `/v1/comment/byPostsId?page=${params.page}&posts_id=${params.posts_id}`
  ); //获取评论列表

export const circleByplateid = (params) =>
  service.get("/v1/posts/circle/byplateid?plate_id=-1", params); //根据圈子分类id获取圈子(这里写死只获取最火圈子列表)

export const circleSearch = (params) =>
  service.get("/v1/posts/circle/search?keyword=" + params.keyword); //搜索圈子
export const gettags = (params) => service.get("/v1/posts/tags" + params.id); //热门话题

export const tagsDetail = (params) =>
  service.get("/v1/posts/detail" + params.id); //话题详情

export const recommendSearch = (params) =>
  service.get("/v1/tags/recommend?search=" + params.keyword); //搜索话题

export const tagsAdd = (params) => service.post("/v1/tags/add", params); //添加话题

export const postAdd = (params) => service.post("/v1/post/add", params); //发布帖子

export const postsPay = (params) => service.post("/v1/posts/pay", params); //帖子支付(支付硬币)

export const balancePay = (params) => service.post("/v1/balance_pay", params); //组合支付

export const getDetailsMessages = (params) =>
  service.get("/v1/massages/getDetailsMessages" + params.id); //通知类型列表

export const readMessages = (params) =>
  service.get("/v1/massages/readMessages" + params.id); //读取消息
export const info = (params) => service.get("/v1/massages/info"); //未读消息
export const getUserChatList = (params) =>
  service.get("/v1/massages/getUserChatList"); //消息列表

export const getUserChat = (params) =>
  service.get("/v1/massages/getUserChat" + params.id); //消息详情
export const configData2 = (params) =>
  service.get("/v1/configData" + params.id); //表情包

export const commentAdd = (params) => service.post("/v1/comment/add", params); //回复帖子

export const addChat = (params) => service.post("/v1/massages/addChat", params); //发送数据
export const readUserChat = (params) =>
  service.get("/v1/massages/readUserChat" + params.id); //已读数据

export const list = (params) => service.get("/v1/search/my/list"); //搜索历史记录
export const Hotlist = (params) => service.get("/v1/search/hot/list"); //搜索热门记录
export const myDelSearch = (params) =>
  service.get("/v1/user/myDelSearch" + params.id); //删除历史记录

export const postsDetail = (params) =>
  service.get("/v1/posts/detail?posts_id=" + params.id); //根据帖子id查询帖子详情

export const postsByCircleId = (params) =>
  service.get(
    `/v1/posts/byCircleId?circle_id=${params.id}&type=${params.type}&page=${params.page}`
  ); //查询圈子帖子列表

export const userPosts = (params) =>
  service.get(
    `/v1/user/posts?type=${params.type}&page=${params.page}&limit=${params.limit}`
  ); //获取与用户相关的笔记
export const users = (params) => service.get("/v1/user/users" + params.id); //获取用户数据

export const signtask = (params) => service.get("/v1/signtask"); //每日数据

export const taskHall = (params) =>
  service.get("/v1/task/hall?type=" + params.type); //获取用户成长任务

export const complete = (params) =>
  service.post("/v1/user/task/complete", params); //领取奖励

// &limit=${params.limit}
export const sign = (params) => service.post("/v1/user/sign"); //签到

export const indexSearch = (params) =>
  service.get(
    `/v1/index/search?keyword=${params.keyword}&type=${params.type}&page=${params.page}`
  ); //帖子搜索

export const searchCount = (params) =>
  service.get("/v1/search/count?keyword=" + params.keyword); //获取帖子搜索数量

export const postsTagsv2 = (params) =>
  service.get(`/v1/posts/tagsv2?tag_id=${params.id}&page=${params.page}`); //根据话题id 获取帖子列表

export const tagsInfo = (params) =>
  service.get(`/v1/tags/info?id=${params.id}`); //获取话题详情

export const userDelMessage = (params) =>
  service.get("/v1/massages/userDelMessage" + params.id); //删除记录

export const userReport = (params) => service.post("/v1/user/report", params); //举报帖子

export const membersdata = (params) => service.get("/v1/user/membersdata"); //会员配置

export const commentByCommentId = (params) =>
  service.get(
    `/v1/comment/byCommentId?comment_id=${params.comment_id}&page=${params.page}&begin_id=${params.begin_id}`,
    params
  ); // 内层评论分页

export const userUpdateInfo = (params) =>
  service.post("/v1/user/update/info", params); //社区更新用户信息

export const appOrder = (params) => service.post("/v1/app/order", params); //二维码支付

export const payStatus = (params) => service.post("/v1/app/pay/status", params); //查询订单状态

export const getUserInfo = (params) => service.get("/v1/user/info"); //获取当前用户信息
export const xiugaiinfo = (params) =>
  service.post("/v1/user/update/info", params); //修改当前用户信息

export const myFinancialSetUserid = (params) =>
  service.get(`/v1/user/myFinancial?setUserid=${params.id}`, params); //获取用户余额

export const commentLikeAdd = (params) =>
  service.post("/v1/comment/like/add", params);
//评论点赞
export const uploads = (params, headers) =>
  service.post("/v1/files/uploads", params, headers); //上传图片
export const getcode = (params, headers) =>
  service.post("/v1/login/phone/code", params, headers); //上传图片
export const snslogin = (params, headers) =>
  service.post("/v1/login/phone", params, headers); //
export const scanCode = (params, headers) => service.get("/v1/login/scan", params, headers); //扫码登录二维码
export const scanLogin = (params, headers) => service.post("/v1/login/scan", params, headers); //扫码登录轮询
